/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tkatva.soalog.SoalogEjb.entities;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author tuomas
 */
@Entity
@Table(name = "entry_values")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "EntryValues.findAll", query = "SELECT e FROM EntryValues e")})
public class EntryValues implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "value_id")
    private Integer valueId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "value_name")
    private String valueName;
    @Size(max = 5000)
    @Column(name = "entry_value")
    private String entryValue;
    @JoinColumn(name = "log_entry_id", referencedColumnName = "log_entry_id")
    @ManyToOne(optional = false)
    private LogEntry logEntryId;

    public EntryValues() {
    }

    public EntryValues(Integer valueId) {
        this.valueId = valueId;
    }

    public EntryValues(Integer valueId, String valueName) {
        this.valueId = valueId;
        this.valueName = valueName;
    }

    public Integer getValueId() {
        return valueId;
    }

    public void setValueId(Integer valueId) {
        this.valueId = valueId;
    }

    public String getValueName() {
        return valueName;
    }

    public void setValueName(String valueName) {
        this.valueName = valueName;
    }

    public String getEntryValue() {
        return entryValue;
    }

    public void setEntryValue(String entryValue) {
        this.entryValue = entryValue;
    }

    public LogEntry getLogEntryId() {
        return logEntryId;
    }

    public void setLogEntryId(LogEntry logEntryId) {
        this.logEntryId = logEntryId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (valueId != null ? valueId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EntryValues)) {
            return false;
        }
        EntryValues other = (EntryValues) object;
        if ((this.valueId == null && other.valueId != null) || (this.valueId != null && !this.valueId.equals(other.valueId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "tkatva.soalog.SoalogEjb.entities.EntryValues[ valueId=" + valueId + " ]";
    }
    
}
